package restaurant;

/**
 * The Command object to add a menu item.
 * 
 * @author Ebonie
 */

public class cmdAddMenuItem implements Command
{

	/** The info. */
	private InformationAggregator info;

	/** The name. */
	private String name;

	/** The description. */
	private String description;

	/** The price. */
	private double price;

	/** The prep time. */
	private int prepTime;

	/** The course. */
	private String course;

	/** The vegetarian. */
	private boolean vegetarian;



	/**
	 * Instantiates a new cmd add menu item.
	 * 
	 * @param info the info
	 * @param name the name
	 * @param description the description
	 * @param price the price
	 * @param prepTime the prep time
	 * @param course the course
	 * @param vegetarian the vegetarian
	 */
	public cmdAddMenuItem(InformationAggregator info, String name,
			String description, double price, int prepTime, String course,
			boolean vegetarian) {
		this.info = info;
		this.name = name;
		this.description = description;
		this.price = price;
		this.prepTime = prepTime;
		this.course = course;
		this.vegetarian = vegetarian;
	}



	/**
	 * Execute.
	 * 
	 * @return the object
	 * @see restaurant.Command#execute()
	 */
	@Override
	public Object execute()
	{
		// get menu item
		Menu menu = info.getMenu();

		return menu.createItem(name, description, price, prepTime, course,
				vegetarian);
	}

}
